<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FTP私有同步云盘 - {% block title %}{% endblock %}</title>
    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
    <!-- 自定义样式 -->
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    {% block extra_css %}{% endblock %}
</head>
<body>
    <header>
        <div class="container">
            <h1><i class="bi bi-cloud-arrow-up-down"></i> FTP私有同步云盘</h1>
            <nav>
                {% if current_user.is_authenticated %}
                    <span><i class="bi bi-person-circle"></i> {{ current_user.username }}</span>
                    <a href="{{ url_for('dashboard') }}"><i class="bi bi-speedometer2"></i> 仪表盘</a>
                    <a href="{{ url_for('logout') }}"><i class="bi bi-box-arrow-right"></i> 退出</a>
                {% else %}
                    <a href="{{ url_for('login') }}"><i class="bi bi-box-arrow-in-right"></i> 登录</a>
                    <a href="{{ url_for('register') }}"><i class="bi bi-person-plus"></i> 注册</a>
                {% endif %}
            </nav>
        </div>
    </header>

    <main>
        <div class="container">
            {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                    <div class="flash-messages">
                        {% for category, message in messages %}
                            <div class="flash flash-{{ category if category else 'info' }}">
                                {{ message }}
                            </div>
                        {% endfor %}
                    </div>
                {% endif %}
            {% endwith %}

            {% block content %}{% endblock %}
        </div>
    </main>

    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-info">
                    <p>&copy; 2023-2025 FTP私有同步云盘系统</p>
                    <p class="version">版本: 1.2.0</p>
                </div>
                <div class="footer-links">
                    <a href="#"><i class="bi bi-github"></i> 源码</a>
                    <a href="#"><i class="bi bi-question-circle"></i> 帮助</a>
                    <a href="#"><i class="bi bi-envelope"></i> 反馈</a>
                </div>
            </div>
        </div>
    </footer>

    <!-- 脚本 -->
    <script src="{{ url_for('static', filename='script.js') }}"></script>
    {% block extra_js %}{% endblock %}
</body>
</html>